#include <bits/stdc++.h>
using namespace std;

typedef struct shine
{
    long long ha,hb,hc,S;
}H;
H jewel[1000000];
long long a[1000000];
long long t[3];
long long n;
long long doing=0;
long long S[1000000];

// bool cmp(H a,H b)
// {
//     return a.S>b.S;
// }

bool cmp(H a,H b)
{
    return a.S < b.S;
}

long long getGCD(long long a,long long b)
{
    if(b==0)
    {
        return a;
    }
    return getGCD(b,(a%b));
}

long long lcm(long long a,long long b)
{
    return (a/getGCD(a,b))*b;
}

long long LCM(long long a,long long b,long long c)
{
    return (lcm(a,b)/getGCD(lcm(a,b),c))*c;
}

void dfs(long long n,long long a[],long long i_a,long long t[],long long i_t)
{
    if(i_a==n||i_t==3)
    {
        if(i_t==3)
        {
            jewel[doing].ha=t[0];
            jewel[doing].hb=t[1];
            jewel[doing].hc=t[2];
            doing++;
        }
        return;
    }
    t[i_t]=a[i_a];
    dfs(n,a,i_a+1,t,i_t+1);
    dfs(n,a,i_a+1,t,i_t);
}

int main()
{
    cin>>n;
    for(long long i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a, a+n);

    dfs(n,a,0,t,0);
    
    // for(long long i=0;i<doing;i++)
    // {
    //     jewel[i].S=jewel[i].ha*jewel[i].hb*jewel[i].hc*LCM(jewel[i].ha,jewel[i].hb,jewel[i].hc)/(lcm(jewel[i].ha,jewel[i].hb)*lcm(jewel[i].ha,jewel[i].hc)*lcm(jewel[i].hb,jewel[i].hc));
    // }
    // sort(jewel,jewel+doing,cmp);
    cout<<jewel[0].ha<<" "<<jewel[0].hb<<" "<<jewel[0].hc;
    return 0;
}